package com.example.factory.simple.pay;

/**
 * 支付简单工厂
 */
public class PayFactory {

    public IPay createPayWay(Class<? extends IPay> clazz) {
        try {
            if (clazz != null) {
                return (IPay) clazz.newInstance();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

}
